package com.itheima.sc.impl.pms;

import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.sc.api.pms.CateAttri_RelaApi;
import com.itheima.sc.mapper.pms.CateAttri_RelaMapper;
import com.itheima.sc.pojo.pms.ProductAttribute;
import com.itheima.sc.pojo.pms.ProductCategoryAttributeRelation;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@DubboService
public class CateAttri_RelaImpl extends ServiceImpl<CateAttri_RelaMapper,ProductCategoryAttributeRelation> implements CateAttri_RelaApi {


    @Override  //根据商品分类的id获取相对应关系对象
    public List<ProductCategoryAttributeRelation> genByCategoryId(Integer productCategoryId) {
        LambdaQueryWrapper<ProductCategoryAttributeRelation> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ProductCategoryAttributeRelation::getProductCategoryId,Convert.toLong(productCategoryId));

        //关系表中的对象
        List<ProductCategoryAttributeRelation> relationList = list(wrapper);
        return relationList;
    }
















}
